/*
 * MaitreDuJeu.java
 *
 * Created on 13 avril 2007, 17:47
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;

/**
 * Entity class MaitreDuJeu
 * 
 * @author yas-nico
 */
@Entity
public class MaitreDuJeu implements Serializable {



    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;
    private String pseudo;
    private int nbImmigration;
    /** Creates a new instance of MaitreDuJeu */
    public MaitreDuJeu() {
    }
    
    public MaitreDuJeu( String pseudo) 
    {
        this.pseudo= pseudo;
    }
    
    
    /**
     * Gets the id of this MaitreDuJeu.
     * @return the id
     */
    public Integer getId() {
        return this.id;
    }

    /**
     * Sets the id of this MaitreDuJeu to the specified value.
     * @param id the new id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * Returns a hash code value for the object.  This implementation computes 
     * a hash code value based on the id fields in this object.
     * @return a hash code value for this object.
     */
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (this.getId() != null ? this.getId().hashCode() : 0);
        return hash;
    }

    /**
     * Determines whether another object is equal to this MaitreDuJeu.  The result is 
     * <code>true</code> if and only if the argument is not null and is a MaitreDuJeu object that 
     * has the same id field values as this object.
     * @param object the reference object with which to compare
     * @return <code>true</code> if this object is the same as the argument;
     * <code>false</code> otherwise.
     */
    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MaitreDuJeu)) {
            return false;
        }
        MaitreDuJeu other = (MaitreDuJeu)object;
        if (this.getId() != other.getId() && (this.getId() == null || !this.getId().equals(other.getId()))) return false;
        return true;
    }

    /**
     * Returns a string representation of the object.  This implementation constructs 
     * that representation based on the id fields.
     * @return a string representation of the object.
     */
    @Override
    public String toString() {
        return "Entity.MaitreDuJeu[id=" + getId() + "]";
    }

    public String getPseudo() {
        return pseudo;
    }

    public void setPseudo(String pseudo) {
        this.pseudo = pseudo;
    }

    public int getNbImmigration()
    {
        return nbImmigration;
    }

    public void setNbImmigration(int nbImmigration)
    {
        this.nbImmigration = nbImmigration;
    }
    
}
